<?php
/**
 * 
 * @author Paolo Bertuzzo
 *
 */
namespace Catalog\Form\Element;

use Zend\Form\View\Helper\FormElement as BaseFormElement;
use Zend\Form\ElementInterface;

/**
 */
class FormElement extends BaseFormElement
{

    /**
     * (non-PHPdoc)
     * 
     * @see \Zend\Form\View\Helper\FormElement::render()
     */
    public function render(ElementInterface $element)
    {
        $renderer = $this->getView();
        
        if (!method_exists($renderer, 'plugin'))
            return '';
        
        $helper = $renderer->plugin($element->getAttribute('type'));
        
        return $helper->render($element);
    }
}
?>